package main

import (
	"fmt"
)
//二分查找 
func binaryFind(arr *[6]int,leftIndex int,rightIndex,findValue int){

	if leftIndex>rightIndex{
		fmt.Println("not find=")
		return
	}
	middle:=(leftIndex+rightIndex)/2

	if (*arr)[middle]>findValue{

		binaryFind(arr,leftIndex,middle-1,findValue)
	}else if (*arr)[middle]<findValue{
		binaryFind(arr,middle+1,rightIndex,findValue)
	}else{
		fmt.Println("find=",middle)
	}
}
func main(){

	arr:=[6]int{1,12,32,45,98,100}

	binaryFind(&arr,0,len(arr),45)


}